<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWeibosTable extends Migration
{
    /**
     * Run the migrations.
     * 微博表
     * @return void
     */
    public function up()
    {
        Schema::create('weibos', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('content');
            $table->integer('topic_id')->nullable();
            $table->string('topic')->nullable();
            $table->integer('forward_num')->default(0);
            $table->integer('comment_num')->default(0);
            $table->integer('like_num')->default(0);
            $table->integer('is_forward')->nullable();
            $table->tinyInteger('is_show')->default(1);
            $table->timestamp('created_at');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('weibos');
    }
}
